package com.cn.wanxi.servlet.back.facebook;

import com.cn.wanxi.service.IFacebookService;
import com.cn.wanxi.service.impl.FacebookServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/back/facebook/manage")
public class FacebookManageServlet extends HttpServlet {
    IFacebookService facebookService = new FacebookServiceImpl();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //删除留言
        resp.setContentType("text/html;charset=utf-8");
        req.setCharacterEncoding("UTF-8");
        resp.setCharacterEncoding("UTF-8");
        String fid = req.getParameter("id");
        int id = 0;
        if (!"".equals(fid))
            id = Integer.parseInt(fid);
        int result = facebookService.deleteFacebook(id);
        resp.getWriter().print(result);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

    }
}
